package com.news.cloud.web.model;

import org.springframework.data.domain.Persistable;

import java.util.function.Consumer;

/**
 * Created by hiephn on 2014/07/12.
 */
public abstract class IDResponse<E extends Persistable<Integer>> {
    private int id;

    protected IDResponse() {
    }

    protected IDResponse(int id) {
        this.id = id;
    }

    protected IDResponse(E entity) {
        this.setData(entity);
    }

    public void setData(E entity) {
        this.id = entity.getId();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
